<template>
	<view>
		<view class="flex my-1 w-100 align-center" @click="msgClick">
			<view class="position-relative py-1">
				<u-badge style="top: 1rpx; right: -5rpx;" type="error" :count="msg.noReadNum"></u-badge>
				<u-avatar :src="msg.avatar"></u-avatar>
			</view>
			<view class="flex-1 ml-2">
				<view class="flex justify-between"><text class="font-weight-bold">{{msg.username}}</text> <text class="font-sm text-secondary">{{msg.lastTime}}</text></view>
				<view><text class="font-sm text-secondary">{{msg.lastMsg}}</text></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			msg:{
				type:Object
			}
		},
		methods:{
			msgClick(){
				this.$emit('msgClick',this.msg)
			}
		}
	}
</script>

<style>
</style>
